Skip to content

Add bus routing constraint props#758

Merged
seveibar merged 1 commit into
mainfrom
feat/bus-routing-constraints
Jul 27, 2026
Merged

Add bus routing constraint props#758
seveibar merged 1 commit into
mainfrom
feat/bus-routing-constraints

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Summary

  • add BusProps and the busProps Zod schema
  • accept two or more trace names or port selectors through connections
  • export the new props and regenerate the public props documentation

Why

Autorouters need an author-facing way to identify signals that belong to the same bus. This adds the smallest declarative API needed by core without leaking router-specific tuning into component props.

Developer impact

Circuit authors can declare routing intent with:

<bus name="DATA" connections={["D0", "D1", "D2", "D3"]} />

Validation

  • bun run typecheck
  • bun run build
  • bun test tests/bus.test.ts
  • all required documentation generators
  • bun run format:check

@seveibar
seveibar marked this pull request as ready for review July 27, 2026 04:36
@seveibar
seveibar merged commit 679fc7f into main Jul 27, 2026
5 checks passed
Comment thread tests/bus.test.ts
Comment on lines +1 to +20
import { expect, test } from "bun:test"
import { busProps, type BusProps } from "lib/components/bus"

test("busProps accepts two or more connection references", () => {
const rawProps: BusProps = {
name: "DATA",
connections: ["D0", ".U1 > .D1"],
}

expect(busProps.parse(rawProps)).toEqual(rawProps)
})

test("busProps rejects a single connection", () => {
expect(
busProps.safeParse({
name: "DATA",
connections: ["D0"],
}).success,
).toBe(false)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains two test(...) calls, which violates the rule that a *.test.ts file may have AT MOST one test(...). Please split this into two separate numbered files, e.g. bus1.test.ts (for 'busProps accepts two or more connection references') and bus2.test.ts (for 'busProps rejects a single connection').

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant